package appconfig

import (
	"fmt"
	"github.com/spf13/viper"
)

type Appcon struct {
	Mysql
	Redis
}
type Mysql struct {
	Host     string
	Port     int
	User     string
	Password string
	Database string
}
type Redis struct {
	Host     string
	Port     int
	Password string
}

var Config Appcon

func Init() {
	viper.SetConfigFile("../zhihurpc/appconfig/dev.yaml")
	viper.ReadInConfig()
	viper.Unmarshal(&Config)
	fmt.Println("动态配置", Config)
}
